sumList :: [Int] -> Int
sumList l = foldr (+) 0 l

elemList :: Eq a => a -> [a] -> Bool
elemList el l = foldr (\elemento rec -> rec || (elemento == el)) False l

concatList :: [a] -> [a] -> [a]
concatList l1 l2 = foldr (:) l2 l1

filterList :: (a -> Bool) -> [a] -> [a]
filterList f l = foldr (\e rec -> if f e then e:rec else rec) [] l

mapList :: (a -> b) -> [a] -> [b]
mapList f l = foldr (\e rec -> (f e) : rec) [] l

sumaAlt :: [Int] -> Int
sumaAlt l = snd (foldr (\e rec -> if fst rec then (False, snd rec + e) else (True, snd rec - e)) (True, 0) (reverse l))
